package com.jiamingZhao.test.demo01;

import lombok.Getter;

import java.util.Arrays;
import java.util.IntSummaryStatistics;

@Getter
public enum FOOD {
    BREAD("Bread"),
    MEAT("Meat"),
    VEGETABLE("Vegetable");

    private final String name;
    private FOOD(String name) {
        this.name = name;
    }

    public static FOOD getFood(String name) {
        for (FOOD food : FOOD.values()) {
            if (food.name.equals(name)) {
                return food;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(BREAD.equals(FOOD.getFood("Bread")));
        double[] arr = new double[]{1,2,3,4,5,6,7,8,9,10,11,12,13};
        IntSummaryStatistics intSummaryStatistics = Arrays.stream(arr).boxed().mapToInt(Double::intValue).summaryStatistics();
        System.out.println(intSummaryStatistics);
    }


}
